# def unicode_test(value):
#     import unicodedata
#     name = unicodedata.name(value)
#     value2 = unicodedata.lookup(name)
#     print('value = "%s" ,name ="%s" ,value2="%s"' % (value,name,value2))
#
#
# unicode_test('A')
#
# unicode_test('$')
# unicode_test('\u00a2')
# unicode_test('\u00E9')

# import unicodedata
# a = unicodedata.lookup("LATIN SMALL LETTER E WITH ACUTE")
# print(a)

# snowman = '\u2603'
# print(len(snowman))
#
# ds = snowman.encode('utf-8')
# print(len(ds))


# actor = 'richard gere'
# cat = 'chester'
# weight = 28
#
# print("Our cat %s weighs %s pounds" % (cat, weight))
#
# n = 42
# f =7.03
# s = 'string cheese'
#
# print('%*.*d %*.*f %*.*s' % (10,4,n,10,4,f,10,4,s))
#
# n = 42
# f =7.03
# s = 'string cheese'
# print('{} {} {}'.format(n,f,s))

# print("{0} {2} {1}".format(n,f,s))

# print("{n} {s} {f}".format(n='asd',f='asdas',s=2))

# print('{0:d} {1:f} {2:s}'.format(n,f,s))
#
# print('{0:10d} {1:10f} {2:10s}'.format(n, f, s))
#
# print('{0:>10d} {1:>10f} {2:>10s}'.format(n, f, s))
#
# print('{0:<10d} {1:<10f} {2:<10s}'.format(n, f, s))
#
# print('{0:^10d} {1:^10f} {2:^10s}'.format(n, f, s))
# import re
# result = re.match('you','young frankenstein')
# source = 'Young Frankenstein'

# m = re.sub('n','?',source)
# print(m)


# m = re.split('n',source)
#
# print(m)

# m = re.findall('n.?',source)
# print(m)

# m = re.findall('n.',source)
# print(m)


# m = re.findall('n',source)
# print(m)
# print('found',len(m),'matchs')



# m = re.search('Frank',source)
# print(m.group())


# m = re.match('You',source)
# print("{}".format(m.group()))
#
# m = re.match('^You',source)
# print("{}".format(m.group()))

# m = re.match('.*Frank',source)
# print(m.group())


# import string
# import re

# source = '''I wish I may, I wish I might Have a dish of fish tonight.'''

# m = re.search(r'(?P<DISH>. dish\b).*(?P<FISH>\bfish)', source)
# print(m.group())
# print(m.groups())
# print(m.group('DISH'))
# print(m.group('FISH'))

# m = re.search(r'(.dish\b).*(\bfish)',source)
# print(m.group())
#
# print(m.groups())


# print( re.findall(r'\bfish', source) )
# print(re.findall('(?<=I) wish', source))

# print(re.findall('ght\W',source))



# print(re.findall('[wsh]+',source))




# print(re.findall('[wf]ish',source))
# print(re.findall('fish tonight.$',source))
# print(re.findall('I wish',source))
# print(re.findall('wish|fish',source))
# print(re.findall('wish',source))
# printable = string.printable
# x = 'abc' + '/*' + '\u00ea' + '\u0115'
# print(re.findall('\w',x))
# print(re.findall('\s',printable))



# print(len(printable))
#
# print(printable[50:])


# print(b'\x01abc\xff')

# the_bytes[1] = 127

# blist = [1, 2, 3, 255]
# the_byte_array = bytearray(blist)
#
# print(the_byte_array[3])

# the_bytes = bytes(range(0, 256))
# the_byte_array = bytearray(range(0, 256))
#
# print(the_bytes)
# print(the_byte_array)

import unicodedata
mystery = '\U0001f4a9'
# print(unicodedata.name(mystery))

# pop_bytes = mystery.encode('utf-8')
# print(pop_bytes)

# pop_string = mystery.encode('utf-8')
# print(pop_string)

# poem = '''
#  My kitty cat likes %s,
#      My kitty cat likes %s,
#      My kitty cat fell on his %s
#      And now thinks he's a %s.
#      '''
# args = ('roast beef', 'ham', 'head', 'clam')
# print(poem % args)


# letter = '''
# Dear {salutation} {name},
#      Thank you for your letter. We are sorry that our {product} {verbed} in your
#      {room}. Please note that it should never be used in a {room}, especially
#      near any {animals}.
#      Send us your receipt and {amount} for shipping and handling. We will send
#      you another {product} that, in our tests, is {percent}% less likely to
#      have {verbed}.
#      Thank you for your support.
#      Sincerely,
#      {spokesman}
#      {job_title}
# '''
# response = {
#     'salutation': 'Colonel',
#     'name': 'Hackenbush',
#     'product': 'duck blind',
#     'verbed': 'imploded',
#     'room': 'conservatory',
#     'animals': 'emus',
#     'amount': '$1.38',
#     'percent': '1',
#     'spokesman': 'Edgar Schmeltz',
#     'job_title': 'Licensed Podiatrist'
# }
# print(letter.format(**response))


# mammoth = '''
#     We have seen thee, queen of cheese,
#     Lying quietly at your ease,
#     Gently fanned by evening breeze,
#     Thy fair form no flies dare seize.
#     All gaily dressed soon you'll go
#     To the great Provincial show,
#     To be admired by many a beau
#     In the city of Toronto.
#     Cows numerous as a swarm of bees,
#     Or as the leaves upon the trees,
#     It did require to make thee please,
#     And stand unrivalled, queen of cheese.
#     May you not receive a scar as
#     We have heard that Mr. Harris
#     Intends to send you off as far as
#     The great world's show at Paris.
#     Of the youth beware of these,
#     For some of them might rudely squeeze
#     And bite your cheek, then songs or glees
#     We could not sing, oh! queen of cheese.
#     We'rt thou suspended from balloon,
#     You'd cast a shade even at noon,
#     Folks would think it was the moon
#     About to fall and crush them soon.
#     '''
# import re
# # pat = r"\b[\w']*l\b"
# pat = r'\b\w*[aeiou]{3}[^aeiou\s]*\w*\b'
# print(re.findall(pat,mammoth))
# import struct
# width,height = struct.unpack('<HH',gif[6:10])




